/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package samoloty.view;

import java.awt.Dimension;
import java.awt.Panel;
import java.awt.event.ActionListener;
import java.awt.event.FocusListener;
import java.awt.event.ItemListener;
import java.awt.event.KeyListener;
import javax.swing.ActionMap;
import javax.swing.InputMap;
import samoloty.controler.Controler;

/**
 *
 * @author frankowp
 */
public class DowPanel extends ContentPanel implements IContentPanel {
    public int identity = 1;
    private DowSubPanel dowSubPanel;
    private PlotPanel plotPanel;


    public DowPanel() {
        super();
        initPanel();
    }

    public void setPlotPanel(PlotPanel p){
        plotPanel = p;
        plotPanel.setBounds(1,dowSubPanel.getHeight()-1,288,getHeight()-dowSubPanel.getHeight() );
        add(plotPanel);

    }

    private void initPanel() {
        dowSubPanel = new DowSubPanel();
        dowSubPanel.setPreferredSize(new Dimension(dowSubPanel.getPreferredSize().width, dowSubPanel.getPreferredSize().height-300));
        dowSubPanel.setBounds(0,0,getWidth(),250);
        setLayout(null);
        add(dowSubPanel);
    }

    public void addInfoSubPanel(InfoSubPanel infoPanel){
         infoPanel.setPreferredSize(new Dimension(289,289));
         infoPanel.setBounds(getWidth()-289,dowSubPanel.getHeight()-1,289,getHeight()-dowSubPanel.getHeight()+1);
         add(infoPanel);
    }

    public void setBwTextFocused(){
        dowSubPanel.setBwTextFocused();
    }

    public void setAcRegText(String s){
        dowSubPanel.setAcRegText(s);
    }

    public void addCrewComboBoxItem(String item){
        dowSubPanel.addCrewComboBoxItem(item);
    }

    public void addConfigComboBoxItem(String item){
        dowSubPanel.addConfigComboBoxItem(item);
    }

    public void reset(){
        dowSubPanel.reset();
    }

    

    public String get_vbasicweight() {
        return dowSubPanel.get_vbasicweight();
    }

    public String get_vbasicindex() {
        return dowSubPanel.get_cbasicindex();
    }

    public String get_vcrew() {
        return dowSubPanel.get_vcrew();
    }

    public String get_vpantryfwd() {
        return dowSubPanel.get_vpantryfwd();
    }

    public String get_vpantrymid() {
        return dowSubPanel.get_vpantrymid();
    }

    public String get_vpantryaft() {
        return dowSubPanel.get_vpantryaft();
    }

    public String get_vconfig() {
        return dowSubPanel.get_vconfig();
    }

    public String get_vadjweight() {
        return dowSubPanel.get_vadjweight();
    }

    public String get_vadjindex() {
        return dowSubPanel.get_vadjindex();
    }

    public String get_vadjdescription() {
        return dowSubPanel.get_vadjdescription();

    }

    public void setBwTextFocusListener(FocusListener listener) {
        dowSubPanel.setBwTextFocusListener(listener);
    }

    public void setBiTextFocusListener(FocusListener listener) {
        dowSubPanel.setBiTextFocusListener(listener);
    }

    public void setPantryFwdTextFocusListener(FocusListener listener) {
        dowSubPanel.setPantryFwdTextFocusListener(listener);
    }

    public void setPantryMidTextFocusListener(FocusListener listener) {
        dowSubPanel.setPantryMidTextFocusListener(listener);
    }

    public void setPantryAftTextFocusListener(FocusListener listener) {
        dowSubPanel.setPantryAftTextFocusListener(listener);
    }

    public void setMtowTextFocList(FocusListener listener) {
        dowSubPanel.setMtowTextFocList(listener);
    }

    public void setMlawTextFocList(FocusListener listener) {
        dowSubPanel.setMlawTextFocList(listener);
    }

    public void setCrewComboActionListener(ActionListener listener) {
        dowSubPanel.setCrewComboActionListener(listener);
    }

    public void setAcregKeyListener(KeyListener listener) {
        dowSubPanel.setAcregKeyListener(listener);
    }

    public void hidePantryAft() {
        dowSubPanel.hidePantryAft();
    }

    public void hidePantryMid() {
        dowSubPanel.hidePantryMid();
    }

    public void hidePantryFwd() {
        dowSubPanel.hidePantryFwd();
    }

    public void shiftPantry(String pan, int y) {
        dowSubPanel.shiftPantry(pan, y);
    }

    public void setFirstFieldActive(){
        dowSubPanel.setFirstFieldActive();
    }

    public String getMlaw() {
        return dowSubPanel.getMlaw();
    }

    public void setMlaw(String value) {
        dowSubPanel.setMlaw(value);
    }

    public String getMtow() {
        return dowSubPanel.getMtow();
    }

    public void setMtow(String value) {
        dowSubPanel.setMtow(value);
    }

    public String geTvadj1weight() {
        return dowSubPanel.geTvadj1weight();
    }

    public String geTvadj1index() {
        return dowSubPanel.geTvadj1index();
    }

    public String geTvadj1description() {
        return dowSubPanel.geTvadj1description();
    }

    public String geTvadj2weight() {
        return dowSubPanel.geTvadj2weight();
    }

    public String geTvadj2index() {
        return dowSubPanel.geTvadj2index();
    }

    public String geTvadj2description() {
        return dowSubPanel.geTvadj2description();
    }

    public String geTvadj3weight() {
        return dowSubPanel.geTvadj3weight();
    }

    public String geTvadj3index() {
        return dowSubPanel.geTvadj3index();
    }

    public String geTvadj3description() {
        return dowSubPanel.geTvadj3description();
    }

    public void setConfigListener(ItemListener itemListener) {
        dowSubPanel.setConfigListener(itemListener);
    }

    public Object getConfigItem(){
        return dowSubPanel.getConfigItem();
    }

    @Override
    public int getIdentity() {
        return identity;
    }

    public void setAdjTextFocusListener(FocusListener fl) {
       dowSubPanel.setAdjTextFocusListener(fl);
    }

}
